<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>运单管理</title>
    <link href="__PUBLIC__/css/admin/reset.css" rel="stylesheet" type="text/css">
    <link href="__PUBLIC__/css/admin/zh-cn-system.css" rel="stylesheet" type="text/css">
    <link href="__PUBLIC__/css/admin/table_form.css" rel="stylesheet" type="text/css">
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/css/admin/style/zh-cn-styles1.css" title="styles1" media="screen">
    <link rel="alternate stylesheet" type="text/css" href="__PUBLIC__/css/admin/style/zh-cn-styles2.css" title="styles2" media="screen">
    <link rel="alternate stylesheet" type="text/css" href="__PUBLIC__/css/admin/style/zh-cn-styles3.css" title="styles3" media="screen">
    <link rel="alternate stylesheet" type="text/css" href="__PUBLIC__/css/admin/style/zh-cn-styles4.css" title="styles4" media="screen">
    <script type="text/javascript" src="__PUBLIC__/js/admin/jquery.min.js"></script>
    <script type="text/javascript" src="__PUBLIC__/js/admin/jquery.cookie.js"></script>
    <script type="text/javascript" src="__PUBLIC__/js/admin/styleswitch.js"></script>
    <script type="text/javascript" src="__PUBLIC__/js/admin/admin_common.js"></script>
</head>
<style type="text/css">
    html{
        _overflow-y:scroll
    }
    #search{
        margin: 20px;
    }
    #ord{

        margin: 20px;
        margin-left: 20px;
    }
    table{
        width:100%;
        margin: auto;
        text-align: center;
        background: #fff;
    }
    th{
        background:rgb(18,162,225);
        color: #fff;
        border:solid 1px #fff;
    }
    td{
        background: #ccc;
        border:solid 1px #fff;
    }
</style>
<body>
<div class="subnav">
    <div class="content-menu ib-a blue line-x">
        <p>运单列表</p>
    </div>
</div>


<div class="pad-lr-10 table-list">
    <div id="search">
        <form action="__MODULE__/order/go_search" method="post">
            运单号：<input type="search" name="way" id="way" value="" placeholder="运单号"/>
            时间：
            <input id="date1" class="Wdate" type="text" name="date1" onclick="WdatePicker({maxDate:'#F{$dp.$D(\'date1\')||\'9999-12-31\'}'})"/>
            <input type="submit" name="submit"  value="搜索" style="width: 80px;"/>
        </form>
    </div>

    <form name="myform" id="myform" action="" method="post">
        <div id="ord">
            <table cellspacing="1">
                <tr>
                    <th rowspan="2">下单时间</th>
                    <th rowspan="2">渠道</th>
                    <th rowspan="2">运单号</th>
                    <th rowspan="2">内单号</th><!--添加-->
                    <th rowspan="2">国际单号</th>
                    <th rowspan="2">目的国</th>
                    <th rowspan="2">品名</th>
                    <th rowspan="2">包裹件数</th>
                    <th rowspan="2">计费重量(kg)</th>
                    <th colspan="3">体积</th><!--添加-->
                    <th rowspan="2">结算费用(￥)</th>
                    <th rowspan="2">订单状态</th><!---->
                </tr>
                <tr>
                    <th>长</th>
                    <th>宽</th>
                    <th>高</th>
                </tr>
                <foreach name="data" item="value">
                    <tr>
                        <td><!--{$value['ord_time']}--></td>
                        <td><!--{$value['company']}--></td>
                        <td><!--{$value['way']}--></td>
                        <td class="dbclick" field="inside_no"><!--{$value['inside_no']}--></td>
                        <if condition="$value['transit'] == false">
                            <td>未转运</td>
                            <else/>
                            <td><!--{$value['transit']}--></td>
                        </if>
                        <td><!--{$value['cname']}-->&nbsp;&nbsp;<!--{$value['ename']}--></td>
                        <td><!--{$value['g_cname']}--></td>
                        <td><!--{$value['piece_num']}--></td>
                        <td class="dbclick" field="weight"><!--{$value['weight']}--></td>
                        <td colspan="3" class="dbclick" field="volume"><!--{$value['volume']}--></td>
                        <td><!--{$value['money']}--></td>
                        <td class="dbclick" field="statu"><!--{$value['statu']}--></td>
                        <!--<td>
                            <if condition="$value['ord_status']==1">
                                <a href="javascript:void(0);" style="text-decoration:line-through" title="已付款不能修改">修改</a> |
                                <a href="javascript:void(0);" style="text-decoration:line-through;" title="已付款不能取消">取消</a>
                                <else/>
                                <a href="__MODULE__/Order/edit/nid/&lt;!&ndash;{$value['order_id']}&ndash;&gt;">修改</a> |
                                <a onclick="return ConfirmDel();" href="__MODULE__/Order/del/nid/&lt;!&ndash;{$value['order_id']}&ndash;&gt;">取消</a>
                            </if>
                        </td>-->
                    </tr>
                </foreach>
                <tr>
                    <td colspan="22"><!--{$page}--></td>
                </tr>
            </table>
        </div>
    </form>
</div>

<script type="text/javascript">
    function queren(t){
        if(confirm("确认已付款吗")){
            $.getJSON("__MODULE__/Order/affirm",{ord_status:1,nid:t},function(msg){
                if(msg){
                    document.location.href="__MODULE__/Order";
                }else{
                    alert("确认失败");
                }
            })
        }
    }
    $("td.dbclick").dblclick(function(){
        var td= $(this);
        var txt = td.text();
        var fie =td.attr("field");
        var input = $("<input style='width:100px;height;10px;'type='text' value='"+txt+"'/>");
        td.html(input);
        input.click(function() { return false; });
        //获取焦点
        input.trigger("focus");
        input.blur(function() {
            var newtxt = $(this).val();
            //判断文本有没有修改
            if (newtxt != txt) {
                td.html(newtxt);
                var url=td.parent().last().find(".edit").attr("href");
                if(url==false){
                    alert("已付款或已取消运单不能修改");
                    td.html(txt);
                    return false;
                }else{
                    var url=url.replace(/edit/,'dbl_click');
                    $.getJSON(url,{fie:fie,value:newtxt},function(msg){})
                }
            }else{
                td.html(txt);
            }
        })
    })
</script>

</body>
</html>


